{extend name="_public/table_page" /}

{block name="button"}
<div class="weadmin-block" style="overflow: hidden">
    {if auth("$classuri/add")}
    <button class="layui-btn layui-btn-xs" data-modal='{:url("$classuri/add")}' data-title="添加分类">添加分类</button>
    {/if}
</div>
{/block}

{block name="table"}
<table class="layui-table" lay-even lay-skin="line" lay-size="sm">
    <thead>
    <tr>
        <th>
            <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">&#xe605;</i></div>
        </th>
        <th>id</th>
        <th>上级分类</th>
        <th>标题</th>
        <th>SEO关键词</th>
        <th>SEO描述</th>
        <th>状态</th>
        <th>操作</th>
    </thead>
    <tbody>
    {volist name="list" id="vo"}
    <tr>
        <td>
            <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='{$vo.id}'><i class="layui-icon">&#xe605;</i></div>
        </td>
        <td>{$vo.id}</td>
        <td><span class="layui-word-aux">【{$vo.path}】{:empty($vo.parent.title)?'-根分类':'-'.$vo.parent.title}</span></td>
        <td>{$vo.title}</td>
        <td>{$vo.seo_keyword}</td>
        <td>{$vo.seo_description}</td>
        <td>{:$vo.state?'启用':'禁用'}</td>
        <td>
            <div class="layui-btn-group">
                {if auth("$classuri/edit")}
                <button class="layui-btn layui-btn-xs" href="javascript:;" data-title="编辑分类" data-modal='{:url("$classuri/edit",["id"=>$vo.id])}'>
                    编辑
                </button>
                {/if}
                {if auth("$classuri/change")}
                <button class="layui-btn layui-btn-xs layui-btn-{:$vo.state?'warm':'primary'}" href="javascript:;" data-confirm="确定操作该条数据吗？"
                        data-post='{:url("$classuri/change")}' data-param='id={$vo.id}&state={:abs($vo.state-1)}'>
                    {:$vo.state?'禁用':'启用'}
                </button>
                {/if}
                {if auth("$classuri/del")}
                <button class="layui-btn layui-btn-xs" href="javascript:;"
                        data-confirm="确定要删除吗！" data-post='{:url("$classuri/del")}' data-param='ids={$vo.id}'>
                    删除
                </button>
                {/if}
            </div>
        </td>
    </tr>
    {/volist}
    </tbody>
</table>
{/block}

{block name="script"}
<!--<script src="__ADMIN__/js/browser-md5-file.js"></script>-->
<script src="https://unpkg.com/wangeditor/release/wangEditor.min.js"></script>
{/block}
